<script lang="ts">
import { defineComponent, h } from 'vue';

export default defineComponent({
  props: {
    color: {
      type: String,
      default: 'var(--el-color-primary)'
    }
  },
  setup() {
    return () => h('div', { class: 'dot' });
  }
});
</script>

<style lang="scss" scoped>
.dot {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;

  &::after {
    content: '';
    display: block;
    height: 5px;
    width: 5px;
    border-radius: 50%;
    background-color: v-bind(color);
    animation: pulse 1.5s infinite ease-in-out;
    box-shadow: 0 0 0 0 v-bind(color);
  }
}

@keyframes pulse {
  to {
    box-shadow: 0 0 0 6px transparent;
  }
}
</style>
